<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateFsCompanySecondDepartmentTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('fs_company_second_department', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('fsCompanyId')->default(0)->comment('fs_company.id');
            $table->char('secondDepartmentId', 48)->default('')->comment('二级部门id');
            $table->string('secondDepartmentName', 64)->default('')->comment('二级部门名称');
            $table->unsignedTinyInteger('businessType')->default(0)->comment('业务类型 1品控（稽核）2...');

            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment = '三方供应商-二级部门表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('fs_company_second_department');
    }
}
